package com.itheima02.thread;

public class Demo2_Thread {
    public static void main(String[] args) {
        //创建自定义线程实例
        RunnableThread t = new RunnableThread();
        //创建Thread，参数1：自定义实现Runnable接口的实例，参数2：线程名称
        new Thread(t,"线程1").start();
        new Thread(t,"线程2").start();
    }
}

class RunnableThread implements Runnable {

    @Override
    public void run() {
        for (int i = 1; i <= 10; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }
    }
}